package com.itheima.dao;

import com.itheima.pojo.Employee;
import com.itheima.pojo.Worker;
import org.apache.ibatis.annotations.*;

public interface EmployeeMapper {

    @Select("select * from tb_employee where id = #{id}")
    Employee selectEmployee(int id);

    @Insert("insert into tb_employee(name,age,department)"
            +"values(#{name},#{age},#{department})")
    int insertEmployee(Employee employee);

    @Update("update tb_employee set name = #{name},age = #{age} "
            +"where id = #{id}")
    int updateEmployee(Employee employee);

    @Delete("delete from tb_employee where id = #{id}")
    int deleteEmployee(int id);

    @Select("select * from tb_employee where id = #{param01} " +
            "and name = #{param02}")
    Employee selectEmployeeById(@Param("param01") int id,
                                       @Param("param02") String name);

}
